clc;clear;close all;
addpath('..\..\..\Algorithm');
Area = [1850,1850+500-1,1280,1280+500-1];
load('..\..\mask.mat');
filePath = 'B\Pic_';
Fig = readFigure(filePath);
for f = 1:length(Fig)
    Fig{f,1} = Fig{f,1}(Area(1):Area(2),Area(3):Area(4));
    Fig{f,1} = Fig{f,1}.*MASK;
end
x = linspace(50,120,8);
for i = 1:length(Fig)
    index = mod((i-1),6) + 1;
    figure_index = ceil(i/6);
    img = Fig{i,1};
    img = img + index*randn(size(img));
    img = uint8(img);
    str = ['B=',int2str(x(figure_index)),'\Pic_',int2str(index),'.bmp'];
    imwrite(img,str);
    fprintf("将%s%d.bmp图像存入%s中 \n",filePath,i,str);
end
